using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using Microformats.Interfaces;
using System.IO;
using Microformats.Entities;
using Sgml;

namespace Microformats.Readers
{
    /// <summary>
    /// A type of microformat reader that uses a text reader as its data source.
    /// </summary>
    internal sealed class MicroformatHtmlReader : MicroformatXmlReader
    {
        internal MicroformatHtmlReader(TextReader stream, MicroformatReader currentReader)
        {
            microformatReader = currentReader;
            SgmlReader sgmlReader = new SgmlReader();
            sgmlReader.InputStream = stream;

            reader = sgmlReader;
        }

        internal MicroformatHtmlReader(Stream stream, MicroformatReader currentReader)
        {
            TextReader r = new StreamReader(stream);
            microformatReader = currentReader;
            SgmlReader sgmlReader = new SgmlReader();
            sgmlReader.InputStream = r;

            reader = sgmlReader;
        }
    }
}
